$(document).ready(function (){
    $('#dg').datagrid({
        url:'/box_net/search',
        columns:[[
            {field:'time',title:'上报时间',width: 150},
            {field:'Down_Speed',title:'下载速率',width:100},
            {field:'Is_Default_Line',title:'默认线路',width:100},
            {field:'Line_Type',title:'线路类型',width:100},
            {field:'School_ID',title:'学校ID',width:80},
            {field:'School_Name',title:'学校名称',width:150},
            {field:'host',title:'盒子编号',width:120}
        ]],
        pagination: true,
        pageSize: 50,
        singleSelect: false,
        toolbar: '#tb'
  });

  $('#search').click(function() {
      var schoolname = $("input[name='schoolname']").val();
      var schoolid = $("input[name='schoolid']").val();
      var mintime = $("input[name='mintime']").val();
      var maxtime = $("input[name='maxtime']").val();
      $('#dg').datagrid('reload', {
          schoolname: schoolname,
          schoolid: schoolid,
          mintime: mintime,
          maxtime: maxtime
      });
  });

})
